
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>骡窝窝</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="default" />
    <meta http-equiv="cache-control" content="no-transform"/>
    <meta content="telephone=no" name="format-detection">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <link href="/css/questionnaire.css" rel="stylesheet" type="text/css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/userTravels.css"/>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <script type="text/javascript">

        $(document).ready(function(){
            $('label').click(function(){
                if($(this).children('input').is(":checked")){
                    $(this).css('background-color','#f7edb8');
                    $(this).nextAll().css('background-color','#f8fbf9');
                    $(this).prevAll().css('background-color','#f8fbf9');
                }
            })
        })
    </script>
    <style>

        input[type="radio"]{ position: absolute; left:-999em;}
        input[type="radio"] + label:before { background-position: -20px -21px;}
        input[type="radio"]:checked + label:before { background-position: -20px 2px;}

        .text1{ width:90%; margin:0 auto}
        .big{ width:100%; display:block; height:44px; line-height:44px; margin-bottom:0%;}
        .w1{ width:100%; height:20px}
        .w1 img{ width:100%; }
        #c1{ background:#f8fbf9; color:#8b5c2b; width:18%; text-align: center; font-size:14px; border:#eaeaea 1px solid;height:30px; line-height:30px; display:block; float:left; margin-right:1.4%; border-radius:2px; box-shadow:1px 1px #eaeaea}
        .text1 ul li span{ display:block; color:#8b5c2b; margin-bottom:5%; font-size:14px;}

        @media screen and (max-width: 320px) {/*iphone5s */
            #c1{ width:18%;margin-right:1.3%;}
        }
        @media screen and (max-width: 320px) and (max-height: 480px){/*iphone4s */
            #c1{ width:18%;margin-right:1.3%;}

        }

    </style>

    <script>
        $(function () {

            //获取用户的id
            var user=JSON.parse(sessionStorage.getItem("user"));
            userId=user.id;

            //文档加载完毕后发送异步请求,获取freemarke返回过来的html页面
            $.get("/questionnaires/answer",function (data) {
                $(".veryBig").append(data);


                //答案回显
                $.get("/questionnaires/list",{userId:userId},function (data) {
                    var items=$.map(data, function (item) {
                        return "#"+item;
                    });
                    $.each(items,function (index, ele) {
                        $(ele).prop("checked",true);
                        $(ele).parent(".answer").css('background-color','#f7edb8');
                    })
                });

                //提交调查信息
                $.get("/questionnaires/getQuestionnaireId",function (data) {
                    var names=$.map(data, function (item) {
                        return "input[name=opption"+item.id+"]";
                    });
                    if (names){
                        $.each(names,function (index, item) {
                            $(item).click(function () {
                               var value=$(this).data("id");
                               $.post("/questionnaires/saveOrUpdate",{userId:userId,value:value},function () {
                               })
                            })
                        });
                    }
                });
            });

            //提交意见和建议
            $(".btn1").click(function () {
                var value=$("textarea[name=textarea]").val();
                $.post("/questionnaires/saveEvaluates",{userId:userId,value:value},function (data) {
                    if (data.success){
                        window.location.href="/mine/questionnaireSurveyQuit.html"
                    }else{
                        $(document).dialog({
                            autoClose: 2500,
                            content: data.msg,
                        });
                    }
                })
            })

        })
    </script>

</head>

<body>

<div class="search-head">
    <div class="row nav-search">
        <div class="col">
            <a href="/mine/questionnaireSurveyEnter.html">
                <span><i class="fa fa-chevron-left"></i></span>
            </a>
        </div>
        <div class="col">
            <span style="text-align:center;color: white">问卷调查</span>
        </div>
        <div class="col"></div>
    </div>
</div>

<div class="bgg1"></div>
<div class="lauguage1"> </div>
<div class="slogan1"><img src="/img/travel.jpg"></div>
<div class="text1">
    <ul class="veryBig">

    </ul>
</div>

<div class="please">
    　　如您对我们有什么建议，非常欢迎您向我们提出，我们会非常珍视每一位顾客的意见。</div>

<div class="suggest_nr">
    <textarea name="textarea" placeholder="请输入…"></textarea>
</div>

<div class="btn1"><a href="javascript:;">提　交</a>
</div>
<div class="slogan2_"><img src="/img/slogan2.png"></div>
</body>
</html>
